package com.nf.health.app.customview;

import android.app.Dialog;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;

import com.nf.health.app.MyApplication;
import com.nf.health.app.R;
import com.nf.health.app.utils.ScreentUtils;

/**
 * 手环搜索蓝牙设备弹出框
 * 
 * @author 于亚豪
 * 
 */
public class BoothDeviceDialog extends Dialog{
	private ListView  listview;
	public BoothDeviceDialog(Context context) {
		super(context, R.style.Dialog);
		initView(context);
	}



	public BoothDeviceDialog(Context context, AttributeSet attrs) {
		super(context, R.style.Dialog);
		// TODO Auto-generated constructor stub
		initView(context);
	}
	public BoothDeviceDialog(Context context, AttributeSet attrs, int defStyle) {
		super(context, R.style.Dialog);
		// TODO Auto-generated constructor stub
		initView(context);
	}
	private void initView(Context context){
		View view = View.inflate(context, R.layout.pop_bluetooth_devices, null);
		setContentView(view);
		listview = (ListView) findViewById(R.id.listview);
		ViewGroup.LayoutParams params = listview.getLayoutParams();
		params.width = ScreentUtils.getScreenWidth(MyApplication.getInstance());
		listview.setLayoutParams(params);

	}
	public void setOnListItem(AdapterView.OnItemClickListener onItemClickListener){
		listview.setOnItemClickListener(onItemClickListener);
	}
	public ListView getListview(){
		return listview;
	}
}
